package com.zxy.controller;

import com.zxy.model.OoItem;
import com.zxy.model.OoMaster;
import com.zxy.model.OoMasterQuery;
import com.zxy.service.OoMasterService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/oo")
public class OoMasterController {

    @Resource
    private OoMasterService ooMasterService;

    @PostMapping
    public int insert(@RequestBody OoMaster model) {
        return ooMasterService.insert(model);
    }

    @GetMapping
    public List<OoMaster> select(OoMasterQuery query) {
        return ooMasterService.select(query);
    }

    @GetMapping("/items")
    public List<OoItem> items(String id) {
        return ooMasterService.items(id);
    }
}
